﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VideoClassLibrary.Model;
using VideoClassLibrary.BusinessLogicLayer;

public partial class NewsCategoryManager_AddNewsCategory : AdminUserBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        V_NewsCategory nc = new V_NewsCategory();
        nc.Title = this.txtTitle.Text.ToString();
        nc.Description = this.txtDescription.Text.ToString();
        nc.CreatedTime = DateTime.Now;
        nc.Schoolid = this.CurrentUser.SchoolID;
        NewsCategoryModule ncm = new NewsCategoryModule();
        nc.Updatetime = DateTime.Now;
        int result=ncm.AddNewsCategory(nc);
        if (result == 0)
        {
            PageHelper.AlterMsg("添加失败！！");
           

        }
       
            PageHelper.AlterMsg("添加成功！！");
            Response.Redirect("ViewNewsCategory.aspx");         
    }
}
